<%--
  User: Shengzhao Li
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>偏好设置</title>

</head>
<body>

<div id="log_setting_page" data-role="page" class="page">
    <div data-role="header" data-theme="f">
        <a href="${contextPath}/m/dashboard" data-icon="home" data-direction="reverse"
           data-transition="slide">主页</a>

        <h1>偏好设置</h1>
        <a href="javascript:submitForm();" data-icon="check">更新</a>
    </div>
    <div data-role="content">
        <p class="ui-bar-d ui-corner-top ui-corner-bottom details-area center">
            每天,花点点时间记录下过去的24小时. 许多年后,回忆起,那年那天我做了什么...
        </p>

        <div class="center red" style="display: none;" id="log_setting_success_info">更新设置成功!</div>
        <form:form commandName="logSettingDto" id="log_setting_form" data-ajax="false">
            <ul data-role="listview" data-inset="true">
                <li data-role="fieldcontain">
                    <fieldset data-role="controlgroup">
                        <legend>允许记录位置信息:</legend>
                        <form:radiobutton path="allowRecordPosition" value="true" id="allow_true"/>
                        <label for="allow_true">允许</label>
                        <form:radiobutton path="allowRecordPosition" value="false" id="allow_false"/>
                        <label for="allow_false">禁止</label>
                    </fieldset>
                </li>
            </ul>
        </form:form>
    </div>
    <div data-role="footer" data-position="fixed" data-theme="c">
        <div data-role="navbar">
            <ul>
                <li>
                    <a href="../overview" data-icon="arrow-l" data-direction="reverse" data-transition="flip">返回</a>
                </li>
            </ul>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {
            <c:if test="${param.result}">
            $("#log_setting_success_info").fadeIn(800).delay(800).fadeOut(800);
            </c:if>
        });

        function submitForm() {
            $("#log_setting_form").submit();
        }
    </script>
</div>
</body>
</html>